<?php

/*
=====================================================
 Generic Toolbox - by Carl Wells
-----------------------------------------------------
-----------------------------------------------------
 Copyright (c) 2009 Carl Wells
=====================================================
 THIS IS COPYRIGHTED SOFTWARE
 PLEASE READ THE LICENSE AGREEMENT
=====================================================
 File: system/core/sector.class.php
-----------------------------------------------------
 Purpose: Model of a sector.
=====================================================
*/

class Sector
{

	// CONTRUCTOR
	function Sector(){
	
    }
    
    
    // grab the sectors from a db an return an array
    function getSectors($id = NULL){
	    require_once("db/dbconnect.class.php");
   	 	// connect to database
		$db = new Connection();
		if ($id == NULL){
		$result =  $db->selectQuery("SELECT * FROM `sectors`");
		}else{
		$result =  $db->selectQuery("SELECT * FROM `sectors` WHERE `id` = ".$id);
		}
		
		$array = $db->returnArray($result);
		// return data as an array;
		return $array;
		
    }
    
    function getSectorName(){
    
    }
    
    function addSector(){
    
    }
    
    function deleteSector(){
    
    }
}

?>